package com.nelson.musicplayer.business.home.adapter

import android.widget.LinearLayout
import androidx.viewpager.widget.ViewPager
import com.alibaba.android.vlayout.LayoutHelper
import com.alibaba.android.vlayout.layout.SingleLayoutHelper
import com.chad.library.adapter.base.BaseViewHolder
import com.nelson.musicplayer.R
import com.nelson.musicplayer.base.BaseDelegateAdapter
import com.nelson.musicplayer.source.bean.HomeData

/**
 * @author nelson
 * @since 2020-07-29
 */
class HomeSongAdapter(itemViewType: Int) : BaseDelegateAdapter(R.layout.home_song_group_item, itemViewType) {

    private var mData: List<HomeData.Data>? = null

    fun setData(data: List<HomeData.Data>) {
        mData = data
        notifyDataSetChanged()
    }

    override fun onBindViewHolder(holder: BaseViewHolder, position: Int) {
        val viewPager = holder.getView<ViewPager>(R.id.view_pager)
        val indicatorContainer = holder.getView<LinearLayout>(R.id.indicator_container)
        initViewPager()
        initIndicator()
    }

    private fun initViewPager() {

    }

    private fun initIndicator() {

    }

    override fun getItemCount(): Int = 1

    override fun onCreateLayoutHelper(): LayoutHelper = SingleLayoutHelper()
}